﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="MaterialsPriceHistory.aspx.cs" Inherits="Items_ItemsPriceHistory" Title="История на цените" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
          <br />
          СПИСЪК С ПЛАТОВЕ<asp:GridView ID="gvMaterials" runat="server" AllowPaging="True"   
                    BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" 
                    CellPadding="4" DataKeyNames="MaterialID" DataSourceID="sdsMaterials" 
                    ForeColor="Black" GridLines="Vertical" AutoGenerateColumns="False">
                    <FooterStyle BackColor="#CCCC99" />
                    <RowStyle BackColor="#F7F7DE" />
                    <Columns>
                        <asp:BoundField DataField="ArticleNo" HeaderText="Код" SortExpression="ArticleNo" />                  
                        <asp:BoundField DataField="Article" HeaderText="Име" SortExpression="Article" />                  
                        <asp:BoundField DataField="Description" HeaderText="Описание" SortExpression="Description" />                  
                        <asp:BoundField DataField="Price" HeaderText="Цена" SortExpression="Price" />                  
                        <asp:CommandField ShowSelectButton="True" SelectText="Виж историята" />
                    </Columns>
                    <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                    <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
          <br />
          ИСТОРИЯ<br />
          <asp:GridView ID="gvHistoryMaterials" runat="server" AutoGenerateColumns="False" 
                    BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" 
                    CellPadding="4" DataKeyNames="PriceHistoryMaterialsID" 
                    DataSourceID="sdsPriceHistoryMaterials" ForeColor="Black" 
              GridLines="Vertical">
            <FooterStyle BackColor="#CCCC99" />
        <RowStyle BackColor="#F7F7DE" />
        <Columns>
            <asp:BoundField DataField="ArticleNo" HeaderText="Код" 
                SortExpression="ArticleNo" />
            <asp:BoundField DataField="Article" HeaderText="Обков" 
                SortExpression="Article" />
            <asp:BoundField DataField="Date" HeaderText="Дата" SortExpression="Date" />
            <asp:BoundField DataField="Price" HeaderText="Цена" SortExpression="Price" />
        </Columns>
        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
  
    
    &nbsp;<br />
    <p>
        <asp:SqlDataSource ID="sdsPriceHistoryMaterials" runat="server" 
            ConnectionString="<%$ ConnectionStrings:KonturConnectionString %>" 
      
            SelectCommand="SELECT dbo.PriceHistoryMaterials.PriceHistoryMaterialsID, dbo.Materials.ArticleNo, dbo.Materials.Article, dbo.PriceHistoryMaterials.Date, dbo.PriceHistoryMaterials.Price
FROM         dbo.Materials INNER JOIN
                      dbo.PriceHistoryMaterials ON dbo.Materials.MaterialID = dbo.PriceHistoryMaterials.MaterialID
WHERE dbo.PriceHistoryMaterials.MaterialID = @MaterialID" 
            onselecting="sdsPriceHistoryBM_Selecting">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvMaterials" Name="MaterialID" 
                    PropertyName="SelectedValue" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="sdsMaterials" runat="server" 
        ConnectionString="<%$ ConnectionStrings:KonturConnectionString %>" 
       
            SelectCommand="SELECT MaterialID, ArticleNo, Article, Description, Price, IsBufab FROM Materials Where IsBufab = 'False'">
   </asp:SqlDataSource>
    </p>
</asp:Content>

